import request from './../utils/request.js';

/**
 * 优惠券
 *
 */
export function getCouponDetail(id) {
  return request.get('coupon/detail/' + id, data);
}

export function getCouonList(data) {
  return request.get('coupon/list', data || {});
}
export function getCouponMappingList(data) {
  return request.get('coupon/mapping/list', data || {});
}

export function getCouonMappings(data) {
  return request.get('coupon/can_use', data || {});
}

/**
 * 领取
 * @param coupon_id
 * @returns {*}
 */
export function gainCoupon(coupon_id) {
  return request.post('coupon/gain/' + coupon_id);
}